package com.leil.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.leil.AccountServiceAppilcation;
import com.leil.services.AccountService;

@RestController
public class AccountController {

	
	private static final Logger logger = LoggerFactory.getLogger(AccountServiceAppilcation.class);
	
	@Autowired
	private AccountService accountService;
	
	@RequestMapping(value="/hello/{accountName}", method = RequestMethod.GET)
	public String hello(@PathVariable("accountName") String accountName) {
		logger.info("hahhahahahahha=========================");
		return "Hello Account Controller!!!" + accountName;
	}
	
	@RequestMapping(value = "/getpwd", method = RequestMethod.GET)
	public String getUserPwd(@RequestParam String name) {
		return accountService.getUserPwd(name);
	}
	
	@RequestMapping(value = "/sendmq", method = RequestMethod.GET)
	public String sendMq() {
		return accountService.sendMq();
	}
}
